﻿# This is a special strategy that sets the default values for different AI scores
# All AIs always load data from this strategy, which can then be either added to or overridden by data from its other strategies

ai_strategy_default = {
	icon = "gfx/interface/icons/ai_strategy_icons/placate_population.dds" # Never shown

	# These are the tax levels the AI will try to stay within, though it can go above max tax level if in a financial emergency
	# Using a different value in a strategy will override these values
	desired_tax_level = medium
	max_tax_level = high
	min_tax_level = low
	
	# The AI will avoid getting this much infamy unless it's a wargoal it really wants
	# Using a different value in a strategy will override this value
	undesirable_infamy_level = {
		value = 50
	}
	
	# The AI will never deliberately add wargoals that will bring its infamy this high
	# Using a different value in a strategy will override this value
	unacceptable_infamy_level = {
		value = 100
	}
	
	# How much is the AI's diplomatic acceptance, etc affected by government ideological differences
	# Using a different value in a strategy will override this value
	ideological_opinion_effect_mult = {
		value = 1.0
	}	
	
	# Chance each day that the AI will stop enacting a law that is going to spark a civil war (1 aversion should translate into ~25% chance of avoiding a civil war)
	# Using a different value in a strategy will override this value
	revolution_aversion = {
		value = 5 
	}
	
	# If base chance for law to pass is below this, don't enact it
	# Using a different value in a strategy will override this value
	min_law_chance_to_pass = {
		value = 50
	}

	# How progressive is the AI willing to be when passing laws
	# Using a different value in a strategy will override this value
	max_progressiveness = {
		value = 25
	}  
	
	# How regressive is the AI willing to be when passing laws
	# Using a different value in a strategy will override this value
	max_regressiveness = {
		value = 25 
	}
	
	# Added to base neutrality in diplomatic plays	
	# Using this value in other strategies will function additively
	diplomatic_play_neutrality = {
		value = 50 

		if = {
			limit = {
				any_diplomatic_play = {
					any_scope_play_involved = {
						count >= 2
						country_rank = rank_value:great_power
						is_diplomatic_play_committed_participant = yes
						NOT = { has_technology_researched = multilateral_alliances }
					}
				}
				country_rank >= rank_value:great_power
				NOT = { has_technology_researched = multilateral_alliances }
			}
			add = 20
		}
				
		#if = {
		#	limit = {
		#		has_diplomatic_pact = {
		#			who = scope:target_country.top_overlord
		#			type = rivalry
		#		}							
		#	}
		#	subtract = 100
		#}
		#
		#if = {
		#	limit = {
		#		scope:target_country = {
		#			has_attitude = {
		#				who = scope:target_country.top_overlord
		#				attitude = rebellious
		#			}
		#		}						
		#	}
		#	subtract = 20
		#}
	}
	
	# Added to base boldness in diplomatic plays	
	# Using this value in other strategies will function additively
	diplomatic_play_boldness = {
		value = 50 

		if = { #Taiping should never surrender against China.
			limit = {
				exists = c:TPG
				THIS = c:TPG
				is_diplomatic_play_initiator = yes
			}
			add = 1000
		}

		if = { #Caucasian states should never surrender against Russia
			limit = {
				OR = {
					AND = {		
						exists = c:CIR
						THIS = c:CIR	
					}
					AND = {		
						exists = c:CHC
						THIS = c:CHC	
					}
				}
				c:RUS = {
					is_diplomatic_play_initiator = yes
				}
			}
			add = 1000
		}

		if = { #Likewise for Kazakhstan.
			limit = {
				exists = c:KAZ
				THIS = c:KAZ
				is_diplomatic_play_initiator = yes
			}
			add = 1000
		}
	} 
		
	# How many maneuvers are we OK with using up in the initial phase to add more wargoals
	# Using this value in other strategies will function additively (values below 0 or above 1 have no further effect)
	wargoal_maneuvers_fraction = {
		value = 0.35
		
		if = {
			limit = { 
				scope:enemy_country.country_rank > country_rank 
			}
			add = -0.1
		}
		if = {
            limit = {
                AND = {
                    has_journal_entry = je_manifest_destiny_mexico
                    scope:enemy_country = {
                        OR = {
                            has_state_in_state_region = STATE_CALIFORNIA
                            has_state_in_state_region = STATE_NEVADA
                            has_state_in_state_region = STATE_UTAH
                            has_state_in_state_region = STATE_ARIZONA
                            has_state_in_state_region = STATE_NEW_MEXICO
                            has_state_in_state_region = STATE_TEXAS
                        }
                    }
                }
            }
            add = 0.6
        }
		if = {
            limit = {
                OR = {
                    has_journal_entry = je_sick_man_syria
                    has_journal_entry = je_sick_man_egypt
                }
            }
            add = 0.3
        }
	}
	
	# How many barracks relative to incorporated population should the AI have
	# Using a different value in a strategy will override this value
	wanted_army_ratio = {
		value = 200000 # 1 barrack per 200k incorporated population
	}
	
	# How many naval bases relative to incorporated coastal population should the AI have
	# Using a different value in a strategy will override this value
	wanted_navy_ratio = {
		value = 400000 # 1 naval base per 400k coastal incorporated population
	}	
	
	# Chance each update that the AI is willing to start changing a law (1 = 1%)
	# Using this value in other strategies will function additively
	change_law_chance = { 
		value = 1
	}
	
	# Which IGs should the AI try to put in power
	# Using this value in other strategies will function additively
	pro_interest_groups = {}
	
	# Which IGs should the AI try to avoid putting in power
	# Using this value in other strategies will function additively
	anti_interest_groups = {}	
	
	# Which institutions should the AI prefer to invest in
	# Using this value in other strategies will function additively
	institution_scores = {
		institution_colonial_affairs = {	
			value = 10		
		}				
		institution_social_security = {	
			value = 10		
		}
		institution_workplace_safety = {	
			value = 10		
		}		
		institution_schools = {	
			value = 10	
		}		
		institution_police = {	
			value = 10		
		}		
		institution_health_system = {	
			value = 10	
		}		
		institution_home_affairs = {	
			value = 10		
		}			
		institution_centralization = {	
			value = 10	
			
			if = {
				limit = {
					any_subject_or_below = {
						OR = {
							is_subject_type = subject_type_dependency
							is_subject_type = subject_type_puppet
							is_subject_type = subject_type_vassal
						}
						is_adjacent = root
					}
				}
				add = 125
			}
			
			if = {
				limit = {
					exists = c:ENT
					exists = c:BUE
					OR = {
						this = c:ENT
						this = c:BUE
					}
					OR = {
						has_journal_entry = je_argentina_constitution
						has_journal_entry = je_argentina_constitution_minor
					}
				}
				add = 150
			}
		}			
	}	
	
	# How much value does the AI place on an obligation from another country?
	# Using this value in other strategies will function additively
	obligation_value = {
		value = 5
	
		# Compare ranks - higher rank than us has increased value, lower rank decreased value
		add = {
			value = scope:target_country.country_rank
			multiply = 2
		}
		subtract = {
			value = country_rank
			multiply = 2
		}
		
		# Domineering/Protective AI wants to use the obligation to cajole the country into a subordinate relationship
		if = {
			limit = {
				OR = {
					has_attitude = {
						who = scope:target_country
						attitude = protective
					}
					has_attitude = {
						who = scope:target_country
						attitude = domineering
					}			
				}			
			}
			add = 15
		}
		
		# Rebellious AI wants to use the obligation to break free
		if = {
			limit = {
				has_attitude = {
					who = scope:target_country
					attitude = rebellious
				}				
			}
			add = 30 
		}
		
		# Having an obligation can stop a country from attacking us
		if = {
			limit = {
				scope:target_country = {
					OR = {
						has_attitude = {
							who = root
							attitude = belligerent
						}
						has_attitude = {
							who = root
							attitude = domineering
						}			
					}
				}
			}
			add = 10 
		}

		# Small boost for generally friendly attitudes
		if = {
			limit = {
				OR = {
					has_attitude = {
						who = scope:target_country
						attitude = genial
					}
					has_attitude = {
						who = scope:target_country
						attitude = cooperative
					}						
				}			
			}
			add = 5
		}	

		# If AI doesn't care about them, they don't want an obligation
		if = {
			limit = {
				OR = {
					has_attitude = {
						who = scope:target_country
						attitude = cautious
					}
					has_attitude = {
						who = scope:target_country
						attitude = disinterested
					}				
				}			
			}
			add = -100
		}			
		
		# Countries with Economic Imperialism is always looking to bring more countries into their market
		if = {
			limit = {
				has_strategy = ai_strategy_economic_imperialism
				scope:target_country.country_rank < country_rank
				NOR = {
					scope:target_country = { is_subject = yes }
					has_diplomatic_pact = {
						who = scope:target_country
						type = customs_union
					}					
				}
			}		
			add = 5
		}
	
		multiply = {
			value = "scope:target_country.relations:root"
			multiply = 0.01
			add = 1
			min = 0.5
			max = 2.0				
		}	

		multiply = {
			value = "scope:target_country.ai_army_comparison(root)"
			divide = 10
			add = 1
			min = 0.5
			max = 2.0
		}

		multiply = {
			value = "ai_ideological_opinion(scope:target_country)"
			multiply = 0.025
			add = 1
			min = 0.5
			max = 1.5
		}

		min = 0
		max = 30
	}
	
	# Recklessness multiplies the AI's estimation of its own strength, so at recklessness 2 it believes its forces to be twice as strong as they actually are
	# The AI wants to have at least parity in what it believes its own forces to be and what the enemy forces are, so at recklessness 2 it's OK with only having 50% of the enemy strength
	# Using this value in other strategies will function additively
	recklessness = {
		value = 1
		
		# Braver against pariah countries
		if = {
			limit = {
				scope:target_country.infamy >= infamy_threshold:pariah		
			}
			add = 1
		}		
		
		# Braver against own overlord in general
		if = {
			limit = {
				is_subject_of = scope:target_country				
			}
			add = 1
		}		

		# Opium wars participants should both be confident
		if = {
			limit = {
				has_journal_entry = je_opium_wars
				scope:target_country = {
					has_variable = opium_wars_target
					is_banning_goods = g:opium
				}
			}
			add = 1
		}

		if = {
			limit = {
				has_variable = opium_wars_target
				is_banning_goods = g:opium
				scope:target_country = {
					has_journal_entry = je_opium_wars
				}
			}
			add = 1
		}	
		
		# Ottomans should be extremely confident against owners of Syria and Egypt when they have the relevant JE's
		if = {
			limit = {
				OR = {
					AND = {
						has_journal_entry = je_sick_man_syria
						scope:target_country = {
							OR = {
								owns_entire_state_region = STATE_ALEPPO
								owns_entire_state_region = STATE_SYRIA
								owns_entire_state_region = STATE_LEBANON
								owns_entire_state_region = STATE_PALESTINE
								owns_entire_state_region = STATE_TRANSJORDAN
								owns_entire_state_region = STATE_ADANA
							}
						}
					}
					AND = {
						has_journal_entry = je_sick_man_egypt
						scope:target_country = {
							OR = {
								owns_entire_state_region = STATE_SINAI
								owns_entire_state_region = STATE_UPPER_EGYPT
								owns_entire_state_region = STATE_MIDDLE_EGYPT
								owns_entire_state_region = STATE_LOWER_EGYPT
							}
						}
					}
				}
			}
			add = 10
		}

		# USA should be confident against owners of their Manifest Destiny states
		if = {
			limit = {
				has_journal_entry = je_manifest_destiny_mexico
				scope:target_country = {
					any_scope_state = {
						OR = {
							state_region = s:STATE_CALIFORNIA
							state_region = s:STATE_NEVADA
							state_region = s:STATE_UTAH
							state_region = s:STATE_ARIZONA
							state_region = s:STATE_NEW_MEXICO
							state_region = s:STATE_TEXAS
						}
					}
				}
			}
			add = 1
		}		

		# Ethiopian Thunderdome
		if = {
			limit = {
				has_journal_entry = je_age_of_princes
				scope:target_country = {
					has_journal_entry = je_age_of_princes
				}
			}
			add = 0.5
		}

		#Italian Nightmare
		if = {
			limit = {
				has_journal_entry = je_italian_unification
				scope:target_country = {
					has_journal_entry = je_italian_unification
				}
			}
			add = 0.5
		}

		# Warlord China Thunderdome
		if = {
			limit = {
				has_global_variable = china_shatters
				has_variable = warlord_state
				scope:target_country = {
					has_variable = warlord_state
				}
			}
			add = 0.5
		}

		#Taiping
		if = { 
			limit = {
				exists = c:TPG
				THIS = c:TPG
				scope:target_country = {
					has_journal_entry = je_taiping
				}
			}
			add = 3
		}
	
		#Caucasus
		if = {
			limit = {
				exists = c:CIR
				THIS = c:CIR
				scope:target_country = { 
					this = c:RUS
					}	
				}
			add = 5
			}
		if = { 
			limit = {
				exists = c:CHC
				THIS = c:CHC
				scope:target_country = {
					this = c:RUS
		}
			}
			add = 5
		}
	}
	
	# How likely is the AI to start a diplomatic play against another country if their attitude allows for it
	# Using this value in other strategies will function additively
	aggression = {
		value = 0
			
		# Higher aggression against pariah countries
		if = {
			limit = {
				scope:target_country.infamy >= infamy_threshold:pariah		
			}
			add = 5
		}
		
		# Higher aggression against subject/overlord if domineering or rebellious
		if = {
			limit = {
				OR = {
					is_subject_of = scope:target_country
					scope:target_country = { is_subject_of = root }
				}				
			}
			add = 5
		}		
		
		# Very high aggression against pariah countries by Great Powers
		if = {
			limit = {
				country_rank = rank_value:great_power
				scope:target_country = {
					infamy >= infamy_threshold:pariah
					is_diplomatic_play_committed_participant = no
					is_at_war = no
				}
			}
			add = 25
		}		
		
		# Opium wars aggressor should be very, very aggressive against target if they're banning opium
		if = {
			limit = {
				has_journal_entry = je_opium_wars
				scope:target_country = {
					has_variable = opium_wars_target
					is_banning_goods = g:opium
				}
			}
			add = 100
		}

		if = { #Carving up China
			limit = {
				country_rank >= rank_value:great_power
				exists = c:CHI
				any_country = {
					NOT = { THIS = ROOT }
					country_is_in_europe = yes
					any_scope_state = {
						OR = {
							region = sr:region_north_china
							region = sr:region_south_china
							region = sr:region_manchuria
						}
						is_treaty_port = yes
					}
				}
				scope:target_country = {
					this ?= c:CHI
				}
			}
			add = 10
		}
		else_if = {
			limit = {
				country_rank >= rank_value:great_power
				exists = c:CHI
				any_country = {
					NOT = { THIS = ROOT }
					country_rank >= rank_value:great_power
					any_scope_state = {
						OR = {
							region = sr:region_north_china
							region = sr:region_south_china
							region = sr:region_manchuria
						}
						is_treaty_port = yes
					}
				}
				scope:target_country = {
					this ?= c:CHI
				}
			}
			add = 25
		}

		# Ottomans should be very aggressive against owners of Syria and Egypt when they have the relevant JE's
		if = {
			limit = {
				OR = {
					AND = {
						has_journal_entry = je_sick_man_syria
						scope:target_country = {
							OR = {
								owns_entire_state_region = STATE_ALEPPO
								owns_entire_state_region = STATE_SYRIA
								owns_entire_state_region = STATE_LEBANON
								owns_entire_state_region = STATE_PALESTINE
								owns_entire_state_region = STATE_TRANSJORDAN
								owns_entire_state_region = STATE_ADANA
							}
						}
					}
					AND = {
						has_journal_entry = je_sick_man_egypt
						scope:target_country = {
							OR = {
								owns_entire_state_region = STATE_SINAI
								owns_entire_state_region = STATE_UPPER_EGYPT
								owns_entire_state_region = STATE_MIDDLE_EGYPT
								owns_entire_state_region = STATE_LOWER_EGYPT
							}
						}
					}
				}
			}
			add = 100
		}

		# USA should be extremely aggressive against owners of their Manifest Destiny states
		if = {
			limit = {
				has_journal_entry = je_manifest_destiny_mexico
				scope:target_country = {
					any_scope_state = {
						OR = {
							state_region = s:STATE_CALIFORNIA
							state_region = s:STATE_NEVADA
							state_region = s:STATE_UTAH
							state_region = s:STATE_ARIZONA
							state_region = s:STATE_NEW_MEXICO
							state_region = s:STATE_TEXAS
							state_region = s:STATE_WYOMING
							state_region = s:STATE_COLORADO
							state_region = s:STATE_KANSAS
							state_region = s:STATE_OKLAHOMA
						}
					}
				}
			}
			add = 100
		}

		# Extra french aggression for Haiti renouncing debt payments
		if = {
			limit = {
				has_variable = haiti_stops_paying_france_aggressor				
				scope:target_country = {
					has_variable = haiti_stops_paying_france_target
					any_state = {
						has_claim_by = root
					}
				}				
			}
			add = 5
		}

		# Extra aggression against Peru-Bolivia
		if = {
			limit = {
				scope:target_country = {
					has_journal_entry = je_peru_bolivia
				}
				OR = {
					country_has_primary_culture = cu:south_andean
					country_has_primary_culture = cu:north_andean
				}
			}
			add = 25
		}

		# Veiled Protectorate
		if = {
			limit = {
				has_journal_entry = je_veiled_protectorate
				exists = c:EGY
				scope:target_country = {
					THIS = c:EGY
				}
			}
			add = 5
		}

		# East India Company vs its neighbors
		if = {
			limit = {
				has_journal_entry = je_consolidate_colonial_rule
				scope:target_country = {
					NOT = { is_subject_of = ROOT }
					any_scope_state = {
						OR = {
							state_region = s:STATE_BURMA
							state_region = s:STATE_KACHIN
							state_region = s:STATE_SHAN_STATES
							state_region = s:STATE_SINDH
							state_region = s:STATE_PUNJAB
							state_region = s:STATE_KASHMIR
							state_region = s:STATE_PASHTUNISTAN
							state_region = s:STATE_BALUCHISTAN
							state_region = s:STATE_HIMALAYAS
						}
					}
				}
			}
			add = 5
		}

		if = { #Russian Caucasus
			limit = {
				country_has_primary_culture = cu:russian
				has_law = law_type:law_national_supremacy
				scope:target_country = {
					any_scope_state = {
						OR = {
							state_region = s:STATE_KUBAN
							state_region = s:STATE_DAGESTAN
						}
					}
				}
			}
			add = 10
		}
	
		if = { #Russian Far East
			limit = {
				has_journal_entry = je_the_eastern_border
				scope:target_country = {
					any_scope_state = {
						OR = {
							state_region = s:STATE_OUTER_MANCHURIA
							state_region = s:STATE_JETISY
							state_region = s:STATE_TOMSK
							state_region = s:STATE_KIRGHIZIA
						}
					}
				}
			}
			add = 15
		}

		if = { #Russian Central Asia
			limit = {
				owns_entire_state_region = STATE_URALSK
				owns_entire_state_region = STATE_AKMOLINSK
				owns_entire_state_region = STATE_SEMIRECHE
				scope:target_country = {
					any_scope_state = {
						OR = {
							state_region = s:STATE_UZBEKIA
							state_region = s:STATE_KIRGHIZIA
							state_region = s:STATE_KHIVA
							state_region = s:STATE_TURKMENIA
							state_region = s:STATE_TAJIKISTAN
						}
					}
				}
				can_reach_target_country = yes
			}
			add = 15
		}

		# Aggression against Council Republics
		if = {
			limit = {	
				AND = {
					NOT = {
						has_law = law_type:law_council_republic
					}
					scope:target_country = {
						has_law = law_type:law_council_republic	
					}
				}
			}
			add = 5
		}
		
		if = { # The EIC/Raj should never go against its suzerain, as doing so is suicide
			limit = {
				exists = c:BIC
				this = c:BIC
				is_subject_of = scope:target_country
			}
			multiply = 0.0
		}

		if = { #Indian suzerain will be aggressive against Russia
			limit = {
				AND = {
					c:RUS ?= {
						any_scope_state = {
							OR = {
								state_region = s:STATE_UZBEKIA
								state_region = s:STATE_KIRGHIZIA
								state_region = s:STATE_KHIVA
								state_region = s:STATE_TURKMENIA
								state_region = s:STATE_TAJIKISTAN
							}
						}
					}
					ROOT = {
						country_is_in_europe = yes
		        		OR = {
		        			any_scope_state = {
		        				OR = {
		    						region = sr:region_north_india
		    						region = sr:region_south_india
		    					}
								count >= 3
		        			}
		        			any_country = {
		        				is_subject_of = prev
		        				any_scope_state = {
		        					OR = {
		        						region = sr:region_north_india
		        						region = sr:region_south_india
		        					}
									count >= 3
			        			}
		        			}
		        		}
					}
					scope:target_country = {
						any_scope_state = {
							OR = {
								state_region = s:STATE_EASTERN_AFGHANISTAN
								state_region = s:STATE_WESTERN_AFGHANISTAN
								state_region = s:STATE_MOSCOW
							}
						}
					}
				}
			}
			add = 5
		}
		
        # Switzerland less aggressive and less likely to be target
        if = {
            limit = {
                exists = c:SWI
                THIS = c:SWI
            }
            add = -25
        }
		
        # French conquest of Algeria
		if = {
			limit = {
                exists = c:FRA
                THIS = c:FRA
				scope:target_country = {
					any_scope_state = {
						OR = {
							state_region = s:STATE_TLEMCEN
							state_region = s:STATE_ALGIERS
							state_region = s:STATE_CONSTANTINE
							state_region = s:STATE_TOUGGOURT
							state_region = s:STATE_GHARDAIA
							state_region = s:STATE_SAHARA
							state_region = s:STATE_EAST_SAHARA
						}
					}
				}
			}
			add = 100
		}
			
		#Aggression against unrecognized countries once colonization has begun and already owns state in region
		if = {
			limit = {
				can_reach_target_country = yes
				has_technology_researched = civilizing_mission
				OR = {
					is_country_type = recognized
					is_country_type = colonial
				}
				scope:target_country = {
					is_country_type = unrecognized
					country_is_in_africa = no
				}
				has_interest_marker_in_region = scope:target_country.capital.region
				scope:target_country.capital.region = {
					any_scope_state = {
						owner = root
					}
				}
			}
			add = 10
		}
		
		if = {
			limit = {
				can_reach_target_country = yes
				has_technology_researched = civilizing_mission
				OR = {
					is_country_type = recognized
					is_country_type = colonial
				}
				scope:target_country = {
					is_country_type = unrecognized
					country_is_in_africa = yes
				}
				has_interest_marker_in_region = scope:target_country.capital.region
				scope:target_country.capital.region = {
					any_scope_state = {
						owner = root
					}
				}
			}
			add = 15
		}
		
		#Aggression against unrecognized countries if has claim in region
		if = {
			limit = {
				can_reach_target_country = yes
				has_technology_researched = civilizing_mission
				OR = {
					is_country_type = recognized
					is_country_type = colonial
				}
				scope:target_country = {
					is_country_type = unrecognized
				}
				has_interest_marker_in_region = scope:target_country.capital.region
				scope:target_country.capital.region = {
					has_claim_by = root
				}
			}
			add = 10
		}
	}
	
	# How many levels of construction sector should the AI aim to have
	# Using this value in other strategies will function additively
	wanted_construction_sector_levels = {
		value = 0
		
		add = {
			value = gdp
			divide = 2000000 # 1 construction sector per 2 million gdp								
		}	

		add = {
			value = total_population
			divide = 2000000 # 1 construction sector per 2 million pop					
		}	
		
		if = {
			limit = { has_law = law_type:law_traditionalism }
			multiply = 0.75
		}
		
		if = {
			limit = { 
				OR = {
					has_law = law_type:law_land_based_taxation 
					has_law = law_type:law_consumption_based_taxation
				}
			}
			multiply = 0.75
		}
				
		if = {
			limit = { 
				OR = {
					has_strategy = ai_strategy_resource_expansion
					has_strategy = ai_strategy_industrial_expansion				
				}
			}
			multiply = 1.5		
		}		

		if = {
			limit = { has_strategy = ai_strategy_placate_population }
			multiply = 0.5		
		}
		
		if = {
			limit = { has_strategy = ai_strategy_maintain_mandate_of_heaven }
			multiply = 0.1		
		}		

		min = 1
		max = 100
	}
	
	# Add a multiplier to the score AI assigns to particular building groups (default 1)
	# Using this value in other strategies will result in several multiplications
	building_group_weights = {}
	
	# Which buildings should the AI subsidize
	# Using a different value in a strategy will override this value
	subsidies = {
		building_power_plant = should_have
		building_railway = should_have
		building_trade_center = should_have		
	}
	
	# Specifying values here will override subsidy priorities while at war
	# Using a different value in a strategy will override this value
	war_subsidies = {}	
	
	# How should the AI plan for production and trade of specific goods
	# Using a different value in a strategy will override this value
	goods_stances = {
		small_arms = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = napoleonic_warfare
			}
		}
		artillery = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = artillery
			}
		}
		ammunition = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = general_staff
			}
		}
		aeroplanes = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = military_aviation
				country_rank >= rank_value:major_power
			}
		}
		tanks = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = mobile_armor
				country_rank >= rank_value:major_power
			}
		}
		clippers = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = navigation
				NAND = {
					has_technology_researched = ironclad_tech
					has_technology_researched = gantry_cranes				
				}
				has_port = yes
				country_rank >= rank_value:major_power
			}
		}
		manowars = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = admiralty
				NAND = {
					has_technology_researched = ironclad_tech
					has_technology_researched = gantry_cranes				
				}
				has_port = yes
				country_rank >= rank_value:major_power
			}
		}	
		steamers = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = ironclad_tech
				has_technology_researched = gantry_cranes
				has_port = yes
				country_rank >= rank_value:major_power
			}
		}			
		ironclads = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = ironclad_tech
				has_technology_researched = gantry_cranes
				has_port = yes
				country_rank >= rank_value:major_power				
			}
		}	
		paper = {
			stance = wants_high_supply
			trigger = {
				has_technology_researched = centralization
				total_population >= 1000000
				NOT = { has_law = law_type:law_traditionalism }
			}
		}
		electricity = { 
			stance = wants_high_supply
			trigger = {
				has_technology_researched = electrical_generation
			}
		}			
		coal = { 
			stance = wants_high_supply
			trigger = {
				has_technology_researched = railways
			}
		}	
		engines = { 
			stance = wants_high_supply
			trigger = {
				has_technology_researched = railways
			}
		}		
		dye = { 
			stance = wants_high_supply 
			trigger = {
				has_building = building_textile_mills
				has_technology_researched = lathe
			}
		}
		silk = { 
			stance = wants_high_supply 
			trigger = {
				has_building = building_textile_mills
				total_population >= 1000000
			}
		}
		hardwood = { 
			stance = wants_high_supply 
			trigger = {
				has_building = building_furniture_manufacturies
				total_population >= 1000000
			}
		}		
	}
	
	# How many of its interests should the AI dedicate to regions with unrecognized and decentralized powers
	# Using a different value in a strategy will override this value
	colonial_interest_ratio = {
		value = 0.0

		if = {
			limit = { 
				is_country_type = recognized
				navy_size >= 25 				
			}
			add = 0.1
		}
		
		if = {
			limit = { 
				is_country_type = recognized
				navy_size >= 50 		
			}
			add = 0.1
		}		
		
		if = {
			limit = { 
				is_country_type = recognized
				navy_size >= 75 				
			}
			add = 0.1
		}		
	}

	# How important is it that the AI maintains an interest in a specific strategic region (added on top of region value calculations set in defines)
	# Using this value in other strategies will function additively
	strategic_region_scores = {
		region_anatolia = {
			if = {
				limit = { # Great Powers care about Egyptian-Ottoman conflict in Arabia/Anatolia early game
					exists = c:TUR
					c:TUR = { has_journal_entry = je_sick_man_syria }
					country_rank = rank_value:great_power
					navy_size >= 50
				}
				add = 1000
			}
		}	
		region_arabic = {
			if = {
				limit = { # Great Powers care about Egyptian-Ottoman conflict in Arabia/Anatolia early game
					exists = c:TUR
					c:TUR = { has_journal_entry = je_sick_man_syria }
					country_rank = rank_value:great_power
					navy_size >= 50
				}
				add = 1000
			}
		}
		region_japan = {	
			if = {
				limit = { # Great Powers should try to open Japan
					exists = c:JAP
					c:JAP = { has_law = law_type:law_isolationism }
					has_technology_researched = civilizing_mission	
					country_rank = rank_value:great_power
					navy_size >= 50
				}
				add = 1000
			}
			if = {
				limit = {
					exists = c:JAP
					c:JAP = { has_law = law_type:law_isolationism }
					NOT = { country_rank = rank_value:great_power }
				}
				add = -50
			}				
		}				
		region_nile_basin = {
			if = {
				limit = {
					OR = {
						AND = {
							country_rank = rank_value:great_power
							has_technology_researched = malaria_prevention
						}
						has_journal_entry = scramble_for_africa
					}						
				}
				add = 200
			}		
		}
		region_north_africa = {
			if = {
				limit = {
					OR = {
						AND = {
							country_rank = rank_value:great_power
							has_technology_researched = malaria_prevention
						}
						has_journal_entry = scramble_for_africa
					}		
				}
				add = 200
			}		
		}
		region_senegal = {
			if = {
				limit = {
					OR = {
						AND = {
							country_rank = rank_value:great_power
							has_technology_researched = malaria_prevention
						}
						has_journal_entry = scramble_for_africa
					}		
				}
				add = 200
			}		
		}
		region_niger = {
			if = {
				limit = {
					OR = {
						AND = {
							country_rank = rank_value:great_power
							has_technology_researched = malaria_prevention
						}
						has_journal_entry = scramble_for_africa
					}		
				}
				add = 200
			}		
		}
		region_congo = {
			if = {
				limit = {
					OR = {
						AND = {
							country_rank = rank_value:great_power
							has_technology_researched = malaria_prevention
						}
						has_journal_entry = scramble_for_africa
					}		
				}
				add = 200
			}		
		}
		region_southern_africa = {
			if = {
				limit = {
					OR = {
						AND = {
							country_rank = rank_value:great_power
							has_technology_researched = malaria_prevention
						}
						has_journal_entry = scramble_for_africa
					}		
				}
				add = 200
			}		
		}
		region_zanj = {
			if = {
				limit = {
					OR = {
						AND = {
							country_rank = rank_value:great_power
							has_technology_researched = malaria_prevention
						}
						has_journal_entry = scramble_for_africa
					}		
				}
				add = 200
			}		
		}
		region_north_germany = {
			if = {
				limit = {
					country_is_in_europe = yes
					country_rank >= rank_value:great_power
				}
				add = 100
			}
			if = {
				limit = {
					has_journal_entry = je_german_unification
				}
				add = 1000
			}			
		}
		region_south_germany = {
			if = {
				limit = {
					country_is_in_europe = yes
					country_rank >= rank_value:great_power
				}
				add = 100
			}
			if = {
				limit = {
					has_journal_entry = je_german_unification
				}
				add = 1000
			}				
		}		
		region_north_italy = {
			if = {
				limit = {
					country_is_in_europe = yes
					country_rank >= rank_value:great_power
				}
				add = 100
			}
		}	
		region_south_italy = {
			if = {
				limit = {
					country_is_in_europe = yes
					country_rank >= rank_value:great_power
				}
				add = 100
			}
		}
		region_west_balkans = {
			if = {
				limit = {
					country_is_in_europe = yes
					country_rank >= rank_value:great_power
				}
				add = 50
			}
		}
		region_east_balkans = {
			if = {
				limit = {
					country_is_in_europe = yes
					country_rank >= rank_value:great_power
				}
				add = 50
			}
		}
		region_greece = {
			if = {
				limit = {
					country_is_in_europe = yes
					country_rank >= rank_value:great_power
				}
				add = 50
			}
		}
		region_england = {
			if = {
				limit = {
					country_is_in_europe = yes
					country_rank >= rank_value:great_power
				}
				add = 50
			}
		}	
		region_iberia = {
			if = {
				limit = {
					country_is_in_europe = yes
					country_rank >= rank_value:great_power
				}
				add = 50
			}
		}
		region_rhine = {
			if = {
				limit = {
					country_is_in_europe = yes
					country_rank >= rank_value:great_power
				}
				add = 50
			}
		}	
		region_north_china = {
			if = {
				limit = {
					country_is_in_europe = yes
					country_rank >= rank_value:great_power
					any_country = {
						country_rank >= rank_value:great_power
						any_scope_state = {
							region = sr:region_north_china
							is_treaty_port = yes
						}
					}
				}
				add = 50
			}
		}	
		region_manchuria = {
			if = {
				limit = {
					country_is_in_europe = yes
					country_rank >= rank_value:great_power
					any_country = {
						country_rank >= rank_value:great_power
						any_scope_state = {
							region = sr:region_manchuria
							is_treaty_port = yes
						}
					}
				}
				add = 50
			}
		}			
		region_south_china = {
			if = {
				limit = {
					has_journal_entry = je_opium_wars	
				}
				add = 1000
			}			
		if = {
			limit = {
				country_is_in_europe = yes
				country_rank >= rank_value:great_power
				any_country = {
					country_rank >= rank_value:great_power
					any_scope_state = {
						region = sr:region_south_china
						is_treaty_port = yes
					}
				}
			}
			add = 50
		}
		}
		region_pacific_coast = {
			if = {
				limit = {
					has_variable = monroe_doctrine	
				}
				add = 1000
			}			
		}
		region_great_plains = {
			if = {
				limit = {
					has_variable = monroe_doctrine	
				}
				add = 100
			}			
		}
		region_dixie = {
			if = {
				limit = {
					has_variable = monroe_doctrine	
				}
				add = 100
			}			
		}		
		region_new_england = {
			if = {
				limit = {
					has_variable = monroe_doctrine	
				}
				add = 100
			}			
		}
		region_canada = {
			if = {
				limit = {
					has_variable = monroe_doctrine	
				}
				add = 100
			}			
		}	
		region_the_midwest = {
			if = {
				limit = {
					has_variable = monroe_doctrine	
				}
				add = 100
			}			
		}	
		region_central_america = {
			if = {
				limit = {
					has_variable = monroe_doctrine	
				}
				add = 100
			}			
		}
		region_brazil = {
			if = {
				limit = {
					has_variable = monroe_doctrine	
				}
				add = 100
			}			
		}	
		region_andes = {
			if = {
				limit = {
					has_variable = monroe_doctrine	
				}
				add = 100
			}			
		}
		region_la_plata = {
			if = {
				limit = {
					has_variable = monroe_doctrine	
				}
				add = 100
			}			
		}
		region_gran_colombia = {
			if = {
				limit = {
					has_variable = monroe_doctrine	
				}
				add = 100
			}			
		}		
	}
	
	# How likely should the AI be to have a particular strategic desire towards another country
	# Using this value in other strategies will function additively
	# scope:target_country = target country
	secret_goal_scores = {
		none = {
			value = 0
			
			if = {
				limit = {		
					scope:target_country = { NOT = { is_subject_of = root } }
					root = { NOT = { is_subject_of = scope:target_country } }
				}
				add = 150	
			}				
			
			# Minor german states shouldn't have far-reaching diplomatic ambitions
			if = {
				limit = {
					country_rank < rank_value:major_power
					OR = {
						country_has_primary_culture = cu:north_german
						country_has_primary_culture = cu:south_german					
					}
					scope:target_country = {
						NOR = {
							country_has_primary_culture = cu:north_german
							country_has_primary_culture = cu:south_german						
						}
					}
					scope:target_country = { NOT = { is_subject_of = root } }
					root = { NOT = { is_subject_of = scope:target_country } }					
					NOT = { is_adjacent = scope:target_country }
				}
				add = 1000
			}
			
			if = {
				limit = {
					country_rank = scope:target_country.country_rank
				}
				multiply = 0.5
			}		
		}	
		befriend = {
			value = 200
			
			# AI should be not be friendly with countries it has claims on
			if = {
				limit = {
					can_reach_target_country = yes
					scope:target_country = { 
						any_scope_state = {
							root = { has_claim = prev }
						}	
					}
				}
				subtract = 100
			}
		
			if = {
				limit = {	
					country_rank <= scope:target_country.country_rank
				}
				add = 100
			}
			
			multiply = {
				value = "ai_ideological_opinion(scope:target_country)"
				multiply = 0.05
				add = 1
				min = 0.25
				max = 2.0
			}				
			
			if = {
				limit = {	
					AND = {
						has_law = law_type:law_council_republic
						scope:target_country = {
							has_law = law_type:law_council_republic	
						}
					}
				}
				add = 50
			}

			if = {
				limit = {
					AND = {
						NOT = {
							has_law = law_type:law_council_republic
						}
						scope:target_country = {
							has_law = law_type:law_council_republic	
						}
					}
					
				}
				multiply = 0.10
			}
	
			if = {
				limit = {
					lenient_ai_behavior_trigger = yes
				}
				multiply = 1.5
			}
			
			if = {
				limit = {
					harsh_ai_behavior_trigger = yes
				}
				multiply = 0.75
			}	

			if = {
				limit = {
					scope:target_country.infamy >= infamy_threshold:infamous
				}
				multiply = 0.9
			}	

			if = {
				limit = {
					scope:target_country.infamy >= infamy_threshold:notorious
				}
				multiply = 0.9
			}	

			if = {
				limit = {
					scope:target_country.infamy >= infamy_threshold:pariah
				}
				multiply = 0.5
			}				
			
			if = {
				limit = {
					OR = {
						has_diplomatic_pact = {
							who = scope:target_country
							type = rivalry
						}					
						scope:target_country = { relations:root <= relations_threshold:poor }					
					}				
				}
				multiply = 0.0
			}
		}
		reconcile = {
			value = 0

			# AI should not reconcile with countries it has claims on
			if = {
				limit = {
					can_reach_target_country = yes
					scope:target_country = { 
						any_scope_state = {
							root = { has_claim = prev }
						}	
					}
				}
				subtract = 100
			}
			
			if = {
				limit = {
					OR = {
						has_diplomatic_pact = {
							who = scope:target_country
							type = rivalry
						}	
						scope:target_country = { relations:root <= relations_threshold:poor }		
					}
											
				}
				
				add = 100					
			}
			
			multiply = {
				value = "ai_ideological_opinion(scope:target_country)"
				multiply = 0.05
				add = 1
				min = 0.25
				max = 2.0
			}			
			
			if = {
				limit = {
					AND = {
						NOT = {
							has_law = law_type:law_council_republic
						}
						scope:target_country = {
							has_law = law_type:law_council_republic	
						}
					}
					
				}
				multiply = 0.10
			}		
			
			if = {
				limit = {
					lenient_ai_behavior_trigger = yes
				}
				multiply = 1.5
			}
			
			if = {
				limit = {
					harsh_ai_behavior_trigger = yes
				}
				multiply = 0.75
			}	

			if = {
				limit = {
					scope:target_country.infamy >= infamy_threshold:infamous
				}
				multiply = 0.9
			}	

			if = {
				limit = {
					scope:target_country.infamy >= infamy_threshold:notorious
				}
				multiply = 0.9
			}	

			if = {
				limit = {
					scope:target_country.infamy >= infamy_threshold:pariah
				}
				multiply = 0.5
			}					
		}		
		protect = {
			value = 0
			
			# AI should not protect countries it has claims on
			if = {
				limit = {
					can_reach_target_country = yes
					scope:target_country = { 
						any_scope_state = {
							root = { has_claim = prev }
						}	
					}
				}
				subtract = 100
			}
			
			if = {
				limit = {
					OR = {
						country_rank > scope:target_country.country_rank	
						scope:target_country = { is_subject_of = root }	
					}
				}
				add = 200
			}
			
			multiply = {
				value = "ai_ideological_opinion(scope:target_country)"
				multiply = 0.05
				add = 1
				min = 0.25
				max = 2.0
			}	

			if = {
				limit = {	
					AND = {
						has_law = law_type:law_council_republic
						scope:target_country = {
							has_law = law_type:law_council_republic	
						}
					}
				}
				multiply = 2
			}

			if = {
				limit = {
					AND = {
						NOT = {
							has_law = law_type:law_council_republic
						}
						scope:target_country = {
							has_law = law_type:law_council_republic	
						}
					}
					
				}
				multiply = 0.25
			}

			if = {
				limit = {
					harsh_ai_behavior_trigger = yes
				}
				multiply = 0.75
			}

			if = {
				limit = {
					scope:target_country.infamy >= infamy_threshold:infamous
				}
				multiply = 0.9
			}	

			if = {
				limit = {
					scope:target_country.infamy >= infamy_threshold:notorious
				}
				multiply = 0.9
			}	

			if = {
				limit = {
					scope:target_country.infamy >= infamy_threshold:pariah
				}
				multiply = 0.5
			}				

			if = {
				limit = {
					OR = {
						has_diplomatic_pact = {
							who = scope:target_country
							type = rivalry
						}					
						scope:target_country = { relations:root <= relations_threshold:poor }					
					}				
				}
				multiply = 0.0
			}	

			if = {
				limit = {		
					NOR = {
						country_rank = rank_value:great_power
						has_strategic_adjacency = scope:target_country
						AND = {
							country_rank >= rank_value:major_power
							scope:target_country = { is_country_type = unrecognized }
						}						
					}
				}
				multiply = 0.0					
			}

			if = {
				limit = {		
					is_subject_of = scope:target_country	
				}
				multiply = 0.0	
			}				
		}		
		antagonize = {
			value = 0
			
			# AI should be antagonistic towards countries it has claims on
			if = {
				limit = {
					can_reach_target_country = yes
					scope:target_country = { 
						any_scope_state = {
							root = { has_claim = prev }
						}	
					}
				}
				add = 50
			}
      
			if = {
				limit = {
					countries_are_valid_rivals = yes
				}
				add = 50
			}
			
			if = {
				limit = {		
					has_diplomatic_pact = {
						who = scope:target_country
						type = rivalry
					}	
				}
				add = 100
			}
			
			if = {
				limit = {
					can_reach_target_country = yes	
					NOT = { is_subject_of = scope:target_country }
				}
				add = 50
			}			
			
			if = {
				limit = {		
					is_subject_of = scope:target_country	
				}
				add = 100			
			}
			
			multiply = {
				value = "ai_ideological_opinion(scope:target_country)"
				multiply = -0.05
				add = 1
				min = 0.25
				max = 2.0
			}							
			
			if = {
				limit = {
					lenient_ai_behavior_trigger = yes
				}
				multiply = 0.75
			}
			
			if = {
				limit = {
					harsh_ai_behavior_trigger = yes
				}
				multiply = 1.5
			}	
			
			if = {
				limit = {
					has_game_rule = high_ai_aggression
				}
				multiply = 0.75 # Yes, this is actually intended to be a decrease - AI should want to conquer/dominate more instead
			}			

			if = {
				limit = {
					has_game_rule = low_ai_aggression
				}
				multiply = 1.5 # Yes, this is actually intended to be an increase - it's to partially compensate for lowered conquer/dominate desires
			}				
			
			if = {
				limit = {		
					scope:target_country = { is_subject_of = root }		
				}
				multiply = 0.0	
			}
			
			if = {
				limit = {
					AND = {
						NOT = {
							has_law = law_type:law_council_republic
						}
						scope:target_country = {
							has_law = law_type:law_council_republic	
						}
					}
					
				}
				add = 100
			}	
			
			if = {
				limit = {
					AND = {
						country_rank = rank_value:great_power
						NOT = {
							has_law = law_type:law_council_republic
						}
						scope:target_country = {
							has_law = law_type:law_council_republic	
						}
					}
					
				}
				multiply = 3
			}	

			# Shouldn't usually upset diplomatic pacts unless they're bankrupt or infamous
			if = {
				limit = {
					scope:target_country = { 
						in_default = no 
						infamy < infamy_threshold:notorious
					}						
				}

				if = {
					limit = {
						has_diplomatic_pact = {
							who = scope:target_country
							type = defensive_pact
						}	
					}
					multiply = 0.5
				}	

				if = {
					limit = {
						has_diplomatic_pact = {
							who = scope:target_country
							type = alliance
						}		
					}
					multiply = 0.25
				}	

				if = {
					limit = {
						has_diplomatic_pact = {
							who = scope:target_country
							type = trade_agreement
						}			
					}
					multiply = 0.5
				}				

				if = {
					limit = {
						has_diplomatic_pact = {
							who = scope:target_country
							type = customs_union
						}								
					}
					multiply = 0.25
				}				
			}				
			
			if = {
				limit = { is_still_learning = yes }
				multiply = 0
			}		
		}
		conquer = {
			value = 0
	
			# AI should want to conquer countries it has claims on
			if = {
				limit = {
					can_reach_target_country = yes
					scope:target_country = { 
						any_scope_state = {
							root = { has_claim = prev }
						}	
					}
				}
				add = 50
			}
			
			if = {
				limit = {
					can_reach_target_country = yes
					NOT = { is_country_type = unrecognized }
					scope:target_country = { NOT = { is_country_type = unrecognized } }
				}
				add = 10	
			}		
	
			if = {
				limit = {
					can_reach_target_country = yes
					NOT = { is_country_type = unrecognized }
					scope:target_country = { is_country_type = unrecognized }
				}
				add = 60
				
				if = {
					limit = { has_technology_researched = civilizing_mission }
					add = 60
				}					
			}			
			
			if = { 
				limit = {
					can_reach_target_country = yes
					is_country_type = unrecognized
					scope:target_country = { is_country_type = unrecognized }						
				}
				add = 25
			}
			
			if = {
				limit = {
					can_reach_target_country = yes
					scope:target_country = { 
						any_scope_state = {
							root = { has_claim = prev }
						}	
					}
				}
				add = 200
			}
			
			if = {
				limit = {
					has_journal_entry = je_sick_man_syria
					exists = c:EGY
					scope:target_country = c:EGY
				}
				add = 200
			}
			
			if = {
				limit = {
					has_journal_entry = je_opium_wars
					scope:target_country = {
						has_variable = opium_wars_target
					}
				}
				add = 200
			}
			
			if = {
				limit = {
					has_journal_entry = je_boxer_rebellion
					scope:target_country = {
						any_scope_state = {
							state_region = { is_homeland = cu:han }
						}
					}
				}
				add = 200
			}
			
			if = {
				limit = {
					has_journal_entry = je_greek_nationalism
					scope:target_country = {
						any_scope_state = {
							state_region = { is_homeland = cu:greek }
						}
					}
				}
				add = 200
			}
			
			if = {
				limit = {
					has_journal_entry = je_consolidate_colonial_rule
					scope:target_country = {
						any_scope_state = {
							OR = {
								state_region = s:STATE_BURMA
								state_region = s:STATE_KACHIN
								state_region = s:STATE_SHAN_STATES
								state_region = s:STATE_SINDH
								state_region = s:STATE_PUNJAB
								state_region = s:STATE_KASHMIR
								state_region = s:STATE_PASHTUNISTAN
								state_region = s:STATE_BALUCHISTAN
								state_region = s:STATE_HIMALAYAS
							}
						}
					}
				}
				add = 200
			}
			
			if = {
				limit = {
					has_journal_entry = je_age_of_princes
					scope:target_country = {
						any_scope_state = {
							OR = {
								state_region = s:STATE_AMHARA
								state_region = s:STATE_GONDER
							}
						}
					}
				}
				add = 200
			}
			
			if = {
				limit = {
					has_journal_entry = je_manifest_destiny_mexico
					scope:target_country = {
						any_scope_state = {
							OR = {
								state_region = s:STATE_CALIFORNIA
								state_region = s:STATE_NEVADA
								state_region = s:STATE_UTAH
								state_region = s:STATE_ARIZONA
								state_region = s:STATE_NEW_MEXICO
								state_region = s:STATE_TEXAS
								state_region = s:STATE_WYOMING
								state_region = s:STATE_COLORADO
								state_region = s:STATE_KANSAS
								state_region = s:STATE_OKLAHOMA
							}
						}
					}
				}
				add = 1000
			}
			
			if = {
				limit = {
					has_journal_entry = je_conquer_oregon
					scope:target_country = {
						any_scope_state = {
							OR = {
								state_region = s:STATE_WASHINGTON
								state_region = s:STATE_IDAHO
								state_region = s:STATE_OREGON
							}
						}
					}
				}
				add = 1000
			}
			
			if = {
				limit = {
					has_journal_entry = je_alaska
					scope:target_country = {
						any_scope_state = {
							state_region = s:STATE_ALASKA
						}
					}
				}
				add = 1000
			}
			
			if = {
				limit = {
					country_has_primary_culture = cu:russian
					has_law = law_type:law_national_supremacy
					scope:target_country = {
						any_scope_state = {
							OR = {
								state_region = s:STATE_KUBAN
								state_region = s:STATE_DAGESTAN
							}
						}
					}
				}
				add = 1000
			}


			if = {
				limit = {
					country_has_primary_culture = cu:russian
					has_law = law_type:law_national_supremacy
					has_technology_researched = nationalism
					OR = {
						AND = {	
							exists = c:KZH
							scope:target_country = {
								this = c:KZH
							}
						}
						AND = {	
							exists = c:UZH
							scope:target_country = {
								this = c:UZH
							}
						}
						AND = {	
							exists = c:OZH
							scope:target_country = {
								this = c:OZH
							}
						}
					}
				}
				add = 50
			}
			
			multiply = {
				value = "ai_ideological_opinion(scope:target_country)"
				multiply = -0.05
				add = 1
				min = 0.25
				max = 2.0
			}	

			if = {
				limit = { scope:target_country = { has_modifier = declared_bankruptcy } }
				multiply = 2.0
			}			
			
			if = {
				limit = {
					AND = {
						NOT = {
							has_law = law_type:law_council_republic
						}
						scope:target_country = {
							has_law = law_type:law_council_republic	
						}
					}
					
				}
				add = 250
			}			
			
			if = {
				limit = {
					lenient_ai_behavior_trigger = yes
				}
				multiply = 0.25
			}
			
			if = {
				limit = {
					harsh_ai_behavior_trigger = yes
				}
				multiply = 1.25
			}
			
			if = {
				limit = {
					has_game_rule = high_ai_aggression
				}
				multiply = 1.5
			}
			
			if = {
				limit = {
					has_game_rule = low_ai_aggression
				}
				multiply = 0.5
			}			

			# Shouldn't usually upset diplomatic pacts unless they're bankrupt or infamous
			if = {
				limit = {
					scope:target_country = { 
						in_default = no 
						infamy < infamy_threshold:notorious
					}						
				}

				if = {
					limit = {
						has_diplomatic_pact = {
							who = scope:target_country
							type = defensive_pact
						}	
					}
					multiply = 0.5
				}	

				if = {
					limit = {
						has_diplomatic_pact = {
							who = scope:target_country
							type = alliance
						}		
					}
					multiply = 0.25
				}	

				if = {
					limit = {
						has_diplomatic_pact = {
							who = scope:target_country
							type = trade_agreement
						}			
					}
					multiply = 0.5
				}				

				if = {
					limit = {
						has_diplomatic_pact = {
							who = scope:target_country
							type = customs_union
						}								
					}
					multiply = 0.25
				}				
			}

			if = {
				limit = {		
					is_subject_of = scope:target_country	
				}
				multiply = 0.0	
			}			
			
			if = {
				limit = { is_still_learning = yes }
				multiply = 0
			}
		}		
		dominate = {
			value = 0		
			
			# AI should want to conquer countries it has claims on, not dominate
			if = {
				limit = {
					can_reach_target_country = yes
					scope:target_country = { 
						any_scope_state = {
							root = { has_claim = prev }
						}	
					}
				}
				subtract = 50
			}
			
			if = {
				limit = {
					scope:target_country = { is_subject_of = root }	
				}
				add = 100
			}
      
			if = {
				limit = {
					scope:target_country = { 
						is_subject_of = root
						relations:root < relations_threshold:cordial 
						scope:target_country.country_rank < rank_value:major_power
					}
				}
				add = 50
			}	

			if = {
				limit = {
					can_reach_target_country = yes
					country_rank > scope:target_country.country_rank
					NOT = { is_country_type = unrecognized }
					scope:target_country = { is_country_type = unrecognized }
					scope:target_country = { NOT = { is_subject_of = root }	}
				}
				add = 30
				
				if = {
					limit = { has_technology_researched = civilizing_mission }
					add = 30
				}					
			}			
			
			if = {
				limit = {
					can_reach_target_country = yes
					country_rank > scope:target_country.country_rank
					scope:target_country.country_rank < rank_value:major_power
					scope:target_country = { NOT = { is_subject_of = root }	}
				}
				add = 25
			}
			
			if = {
				limit = {
					OR = {
						has_journal_entry = je_sick_man_syria
						has_journal_entry = je_veiled_protectorate
					}
					exists = c:EGY
					scope:target_country = c:EGY
				}
				add = 200
			}
			
			multiply = {
				value = "ai_ideological_opinion(scope:target_country)"
				multiply = -0.05
				add = 1
				min = 0.25
				max = 2.0
			}			

			if = {
				limit = {
					AND = {
						NOT = {
							has_law = law_type:law_council_republic
						}
						scope:target_country = {
							has_law = law_type:law_council_republic	
						}
					}
					
				}
				add = 250
			}		

			if = {
				limit = {
					country_has_primary_culture = cu:russian
					has_law = law_type:law_national_supremacy
					has_technology_researched = nationalism
					OR = {
						AND = {	
							exists = c:KZH
							scope:target_country = {
								this = c:KZH
							}
						}
						AND = {	
							exists = c:UZH
							scope:target_country = {
								this = c:UZH
							}
						}
						AND = {	
							exists = c:OZH
							scope:target_country = {
								this = c:OZH
							}
						}
					}
				}
				add = 100
			}
			
			if = {
				limit = {
					AND = {
						country_rank = rank_value:great_power
						NOT = {
							has_law = law_type:law_council_republic
						}
						scope:target_country = {
							has_law = law_type:law_council_republic	
						}
					}
					
				}
				multiply = 3
			}	
			
			if = {
				limit = {
					lenient_ai_behavior_trigger = yes
				}
				multiply = 0.50
			}		
			
			if = {
				limit = { scope:target_country = { has_modifier = declared_bankruptcy } }
				multiply = 2.0
			}			
			
			if = {
				limit = {
					harsh_ai_behavior_trigger = yes
				}
				multiply = 1.5
			}	

			if = {
				limit = {
					has_game_rule = high_ai_aggression
				}
				multiply = 1.5
			}
			
			if = {
				limit = {
					has_game_rule = low_ai_aggression
				}
				multiply = 0.5
			}
			
			# Shouldn't usually upset diplomatic pacts unless they're bankrupt or infamous
			if = {
				limit = {
					scope:target_country = { 
						in_default = no 
						infamy < infamy_threshold:notorious
					}						
				}

				if = {
					limit = {
						has_diplomatic_pact = {
							who = scope:target_country
							type = defensive_pact
						}	
					}
					multiply = 0.5
				}	

				if = {
					limit = {
						has_diplomatic_pact = {
							who = scope:target_country
							type = alliance
						}		
					}
					multiply = 0.25
				}	

				if = {
					limit = {
						has_diplomatic_pact = {
							who = scope:target_country
							type = trade_agreement
						}			
					}
					multiply = 0.5
				}				

				if = {
					limit = {
						has_diplomatic_pact = {
							who = scope:target_country
							type = customs_union
						}								
					}
					multiply = 0.25
				}				
			}			

			if = {
				limit = {		
					NOR = {
						country_rank = rank_value:great_power
						has_strategic_adjacency = scope:target_country 
						AND = {
							country_rank >= rank_value:major_power
							scope:target_country = { is_country_type = unrecognized }
						}
					}
				}
				multiply = 0.0					
			}			
			
			if = {
				limit = {		
					is_subject_of = scope:target_country	
				}
				multiply = 0.0	
			}
			
			if = {
				limit = { is_still_learning = yes }
				multiply = 0
			}
		}			
	}
	
	# How much should the AI value a wargoal against another country/state
	# Using this value in other strategies will function additively
	# scope:target_country = wargoal target country
	# scope:target_state = wargoal target state (if any)
	wargoal_scores = {
		conquer_state = {
			value = 0

			if = {
				limit = {
					has_secret_goal = {
						who = scope:target_country
						secret_goal = conquer
					}					
					can_reach_target_state = yes			
				}
				add = {
					value = 40
				
					subtract = { #AI should want to conquer more smaller states, not less large states
						value = scope:target_state.state_population
						divide = 100000
						max = 20						
					}
					
					add = {
						value = scope:target_state.gdp
						divide = 100000
						max = 20						
					}	

					if = {
						limit = {
							scope:target_state = { 
								is_split_state = yes 
								region = { 
									any_scope_state = { owner = ROOT }
								}
							}
						}
						add = 40
						if = {
							limit = {
								scope:target_state = { 
									is_homeland_of_country_cultures = ROOT
								}
							}
							add = 20
						}
					}

					if = {
						limit = { 
							NOT = { has_strategic_land_adjacency = scope:target_state } 
							scope:target_state = { has_port = no }
						}
						multiply = 0.5
					}
					
					if = {
						limit = { 
							has_strategic_land_adjacency = scope:target_state
							NOT = { is_adjacent = scope:target_state }
						}
						multiply = 0.5
					}
		
					if = {
						limit = {
							has_strategic_land_adjacency = scope:target_country
							NOT = { has_strategic_land_adjacency = scope:target_state }
						}
						multiply = 0.1
					}					

					else_if = {
						limit = {
							is_adjacent = scope:target_country
							NOT = { is_adjacent = scope:target_state }
						}
						multiply = 0.5
					}															
				
					if = {
						limit = {
							scope:target_state = { is_homeland_of_country_cultures = root }
						}
						multiply = 1.5
					}	
				}
			}	
			else_if = {
				limit = {
					OR = {
						has_attitude = {
							who = scope:target_country
							attitude = antagonistic
						}				
						is_diplomatic_play_enemy_of = scope:target_country
						has_war_with = scope:target_country							
					}
					has_strategic_adjacency = scope:target_state
					scope:target_state = { is_homeland_of_country_cultures = root }				
				}
				add = {
					value = 20
				
					subtract = { #AI should want to conquer more smaller states, not less large states
						value = scope:target_state.state_population
						divide = 100000
						max = 10						
					}
					
					add = {
						value = scope:target_state.gdp
						divide = 100000
						max = 10						
					}
					
					if = {
						limit = {
							scope:target_state = { 
								is_split_state = yes 
								region = { 
									any_scope_state = { owner = ROOT }
								}
							}
						}
						add = 40
						if = {
							limit = {
								scope:target_state = { 
									is_homeland_of_country_cultures = ROOT
								}
							}
							add = 20
						}
					}
					
					if = {
						limit = { 
							NOT = { has_strategic_land_adjacency = scope:target_state } 
							scope:target_state = { has_port = no }
						}
						multiply = 0.5
					}									

					if = {
						limit = {
							has_strategic_land_adjacency = scope:target_country
							NOT = { has_strategic_land_adjacency = scope:target_state }
						}
						multiply = 0.1
					}					
					else_if = {
						limit = {
							is_adjacent = scope:target_country
							NOT = { is_adjacent = scope:target_state }
						}
						multiply = 0.5
					}							

					if = {
						limit = {
							country_rank < scope:target_country.country_rank
						}
						multiply = 0.5
					}
				}
			}				

			if = {
				limit = {
					has_journal_entry = je_boxer_rebellion
					scope:target_state.state_region = { is_homeland = cu:han }
				}
				add = 50
			}

			if = {
				limit = {
					has_journal_entry = je_greek_nationalism
					scope:target_state.state_region = { is_homeland = cu:greek }
				}
				add = 50
			}

			if = {
				limit = {
					has_journal_entry = je_consolidate_colonial_rule
					scope:target_state = {
						OR = {
							state_region = s:STATE_BURMA
							state_region = s:STATE_KACHIN
							state_region = s:STATE_SHAN_STATES
							state_region = s:STATE_SINDH
							state_region = s:STATE_PUNJAB
							state_region = s:STATE_KASHMIR
							state_region = s:STATE_PASHTUNISTAN
							state_region = s:STATE_BALUCHISTAN
							state_region = s:STATE_HIMALAYAS
						}
					}
				}
				add = 50
			}

			if = {
				limit = {
					has_journal_entry = je_age_of_princes
					scope:target_state = {
						OR = {
							state_region = s:STATE_AMHARA
							state_region = s:STATE_GONDER
						}
					}
				}
				add = 50
			}

			if = {
				limit = {
					has_journal_entry = je_manifest_destiny_mexico
					scope:target_state = {
						OR = {
							state_region = s:STATE_TEXAS
							state_region = s:STATE_WYOMING
							state_region = s:STATE_COLORADO
							state_region = s:STATE_KANSAS
							state_region = s:STATE_OKLAHOMA
						}
					}
				}
				add = 50
			}

			if = {
				limit = {
					has_journal_entry = je_manifest_destiny_mexico
					scope:target_state = {
						OR = {
							state_region = s:STATE_CALIFORNIA
							state_region = s:STATE_NEVADA
							state_region = s:STATE_UTAH
							state_region = s:STATE_ARIZONA
							state_region = s:STATE_NEW_MEXICO
						}
					}
				}
				add = 45
			}

			if = {
				limit = {
					has_journal_entry = je_manifest_destiny_mexico
					scope:target_state = {
						OR = {
							state_region = s:STATE_BAJA_CALIFORNIA
							state_region = s:STATE_SONORA
							state_region = s:STATE_CHIHUAHUA
							state_region = s:STATE_RIO_GRANDE
						}
					}
				}
				add = 25
			}

			if = {
				limit = {
					has_journal_entry = je_conquer_oregon
					scope:target_state = {
						OR = {
							state_region = s:STATE_WASHINGTON
							state_region = s:STATE_IDAHO
							state_region = s:STATE_OREGON
						}
					}
				}
				add = 50
			}

			if = {
				limit = {
					has_journal_entry = je_alaska
					scope:target_state = {
						state_region = s:STATE_ALASKA
					}
				}
				add = 50
			}
			
			if = {
				limit = {
					has_journal_entry = je_the_eastern_border
					scope:target_state = {
						OR = {
							state_region = s:STATE_OUTER_MANCHURIA
							state_region = s:STATE_JETISY
							state_region = s:STATE_TOMSK
							state_region = s:STATE_KIRGHIZIA
						}
					}
				}
				add = 50
			}

			if = { #Russian Central Asia
				limit = {
					owns_entire_state_region = STATE_URALSK
					owns_entire_state_region = STATE_AKMOLINSK
					owns_entire_state_region = STATE_SEMIRECHE
					scope:target_state = {
						OR = {
							state_region = s:STATE_UZBEKIA
							state_region = s:STATE_KIRGHIZIA
							state_region = s:STATE_KHIVA
							state_region = s:STATE_TURKMENIA
							state_region = s:STATE_TAJIKISTAN
						}
					}
					can_reach_target_state = yes
				}
				add = 50
			}

			if = {
				limit = {
					has_journal_entry = je_sick_man_syria
					scope:target_state = {
						OR = {
							state_region = s:STATE_CRETE
						}
					}
				}
				add = 50
			}			
			
			#if = {
			#	limit = {
			#		country_has_primary_culture = cu:russian
			#		has_law = law_type:law_national_supremacy
			#		has_technology_researched = nationalism
			#		OR = {
			#			AND = {	
			#				exists = c:KZH
			#				scope:target_state.owner = {
			#					this = c:KZH
			#	}
			#	multiply = 1.5
			#}
			#			AND = {	
			#				exists = c:UZH
			#				scope:target_state.owner = {
			#					this = c:UZH
			#		}
			#	}
			#			AND = {	
			#				exists = c:OZH
			#				scope:target_state.owner = {
			#					this = c:OZH
			#				}
			#			}
			#		}
			#		can_reach_target_state = yes
			#	}
			#	add = 50
			#}
		
			if = {
				limit = {
					lenient_ai_behavior_trigger = yes
					scope:target_state = { is_homeland_of_country_cultures = scope:target_country }
				}
				multiply = 0.0
			}

			if = {
				limit = {
					has_journal_entry = je_opium_wars
					scope:target_country = {
						has_variable = opium_wars_target
					}
				}
				multiply = 0
			}
			
			if = {
				limit = {
					is_adjacent = scope:target_country
					has_technology_researched = civilizing_mission
					#replace with colonial law \/
					has_colonial_growth = yes
					OR = {
						is_country_type = recognized
						is_country_type = colonial
					}
					scope:target_country = {
						is_country_type = unrecognized
						country_is_in_africa = no
					}
				}
				add = 5
			}
			
			if = {
				limit = {
					is_adjacent = scope:target_country
					has_technology_researched = civilizing_mission
					has_colonial_growth = yes
					OR = {
						is_country_type = recognized
						is_country_type = colonial
					}
					scope:target_country = {
						is_country_type = unrecognized
						country_is_in_africa = yes
					}
				}
				add = 5
			}
			
			min = 0
			max = 100			
		}
		
		return_state = {
			value = 40

			add = {
				value = scope:target_state.state_population
				divide = 100000
				max = 40
			}
			
			add = {
				value = scope:target_state.gdp
				divide = 100000
				max = 40						
			}					
					
			if = {
				limit = {
					has_strategic_land_adjacency = scope:target_state
					scope:target_state = { 
						is_split_state = yes 
						region = { 
							any_scope_state = { owner = ROOT }
						}
					}
				}
				add = 60
				if = {
					limit = {
						scope:target_state = { 
							is_homeland_of_country_cultures = ROOT
						}
					}
					add = 30
				}
			}
			if = {
				limit = { 
					NOT = { has_strategic_land_adjacency = scope:target_state } 
					scope:target_state = { has_port = no }
				}
				multiply = 0.5
			}
			
			if = {
				limit = {
					has_strategic_land_adjacency = scope:target_country
					NOT = { has_strategic_land_adjacency = scope:target_state }
				}
				multiply = 0.1
			}
			
			if = {
				limit = {
					has_strategic_land_adjacency = scope:target_state
					NOT = { is_adjacent = scope:target_state }
				}
				multiply = 0.5
			}
			else_if = {
				limit = {
					is_adjacent = scope:target_country
					NOT = { is_adjacent = scope:target_state }
				}
				multiply = 0.5
			}
		
			if = {
				limit = {
					scope:target_state = { is_homeland_of_country_cultures = root }
				}
				multiply = 1.5
			}

			if = {
				limit = {
					lenient_ai_behavior_trigger = yes
					scope:target_state = { is_homeland_of_country_cultures = scope:target_country }
					}
				multiply = 0.0
			}

			if = {
				limit = {
					has_journal_entry = je_manifest_destiny_mexico
					scope:target_state = {
						OR = {
							state_region = s:STATE_CALIFORNIA
							state_region = s:STATE_NEVADA
							state_region = s:STATE_UTAH
							state_region = s:STATE_ARIZONA
							state_region = s:STATE_NEW_MEXICO
							state_region = s:STATE_TEXAS
							state_region = s:STATE_WYOMING
							state_region = s:STATE_COLORADO
							state_region = s:STATE_KANSAS
							state_region = s:STATE_OKLAHOMA
						}
					}
				}
				add = 130
			}

			if = {
				limit = {
					has_journal_entry = je_sick_man_syria
					scope:target_state = {
						OR = {
							state_region = s:STATE_ALEPPO
							state_region = s:STATE_SYRIA
							state_region = s:STATE_LEBANON
							state_region = s:STATE_PALESTINE
							state_region = s:STATE_TRANSJORDAN
							state_region = s:STATE_ADANA
						}
					}
				}
				add = 75
			}

			if = {
				limit = {
					has_journal_entry = je_sick_man_egypt
					scope:target_state = {
						OR = {
							state_region = s:STATE_SINAI
							state_region = s:STATE_UPPER_EGYPT
							state_region = s:STATE_MIDDLE_EGYPT
							state_region = s:STATE_LOWER_EGYPT
						}
					}
				}
				add = 50
			}

			if = {
				limit = {
					has_journal_entry = je_the_eastern_border
					scope:target_state = {
						OR = {
							state_region = s:STATE_OUTER_MANCHURIA 
							state_region = s:STATE_JETISY 
							state_region = s:STATE_TOMSK
						}
					}
				}
				add = 75
			}

			min = 0
			max = 200			
		}	
		
		take_treaty_port = {
			value = 0
			
			if = {
				limit = {
					scope:target_country = {
						has_diplomatic_pact = {
							who = root
							type = embargo
						}	
					}
				}
				add = 25
			}

			if = {
				limit = {
					"num_mutual_trade_route_levels_with_country(root)" >= 10
					OR = {
						has_strategy = ai_strategy_economic_imperialism
						AND = {
							NOT = { is_country_type = unrecognized }
							scope:target_country = { is_country_type = unrecognized }
						}
					}
				}

				add = {
					value = 5
				
					add = {
						value = scope:target_state.state_population
						divide = 200000
						max = 10						
					}
					
					add = {
						value = scope:target_state.gdp
						divide = 200000
						max = 10						
					}				
				
					if = {
						limit = {
							any_scope_building = {
								is_building_type = building_trade_center
								level > 0
							}						
						}
						
						add = 5
					}
						
					if = {
						limit = {
							has_strategic_adjacency = scope:target_state		
						}
						multiply = 1.25
					}					
				}										
			}		
						
			if = {
				limit = {
					has_journal_entry = je_opium_wars
					scope:target_country = {
						has_variable = opium_wars_target
					}
				}
				add = 25
			}
			if = {
				limit = {
					has_journal_entry = je_opium_wars
					scope:target_country = {
						has_variable = opium_wars_target
					}
					scope:target_state = {
						state_region = s:STATE_SHAOZHOU
					}					
				}
				add = 1000
			}
			if = {
				limit = {
					has_journal_entry = je_opium_wars
					scope:target_country = {
						has_variable = opium_wars_target
					}
					scope:target_state = {
						state_region = s:STATE_FORMOSA
					}					
				}
				add = -100
			}

			if = { #Carving up China
				limit = {
					country_rank >= rank_value:great_power
					exists = c:CHI
					any_country = {
						NOT = { THIS = ROOT }
						country_is_in_europe = yes
						any_scope_state = {
							OR = {
								region = sr:region_north_china
								region = sr:region_south_china
								region = sr:region_manchuria
							}
							is_treaty_port = yes
						}
					}
					scope:target_state = {
						OR = {
							region = sr:region_north_china
							region = sr:region_south_china
							region = sr:region_manchuria
						}
					}
				}
				add = 25
			}
			else_if = {
				limit = {
					country_rank >= rank_value:great_power
					exists = c:CHI
					any_country = {
						NOT = { THIS = ROOT }
						country_rank >= rank_value:great_power
						any_scope_state = {
							OR = {
								region = sr:region_north_china
								region = sr:region_south_china
								region = sr:region_manchuria
							}
							is_treaty_port = yes
						}
					}
					scope:target_state = {
						OR = {
							region = sr:region_north_china
							region = sr:region_south_china
							region = sr:region_manchuria
						}
					}
				}
				add = 75
			}

			if = {
				limit = {
					has_treaty_port_in_country = scope:target_country
					scope:target_country = { country_rank < unrecognized_regional_power }
				}
				multiply = 0
			}

			if = {
				limit = {
					scope:target_country = { NOT = { is_country_type = unrecognized } }
				}
				multiply = 0.1
			}
			
			if = {
				limit = {
					scope:target_country = {
						has_diplomatic_pact = {
							who = root
							type = trade_agreement
						}	
					}
				}
				multiply = 0
			}
			
			if = {
				limit = {
					can_reach_target_state = no
				}
				multiply = 0
			}			

			min = 0
			max = 100			
		}

		
		make_puppet = {
			if = {
				limit = {
					OR = {
						has_secret_goal = {
							who = scope:target_country
							secret_goal = protect
						}
						has_secret_goal = {
							who = scope:target_country
							secret_goal = dominate
						}						
					}
				}
			
				add = {
					value = 50
				
					add = {
						value = scope:target_country.gdp
						divide = 200000
						max = 50						
					}

					if = {
						limit = {
							has_strategic_adjacency = scope:target_country
						}
						multiply = 1.25
					}						
				}			
			}			
			
			if = {
				limit = {
					OR = {
						has_journal_entry = je_sick_man_egypt
						has_journal_entry = je_veiled_protectorate
					}
					exists = c:EGY
					scope:target_country = c:EGY
				}
				add = 100
			}

			if = {
				limit = {
					country_has_primary_culture = cu:russian
					has_law = law_type:law_national_supremacy
					has_technology_researched = nationalism
					OR = {
						AND = {	
							exists = c:KZH
							scope:target_country = {
								this = c:KZH
							}
						}
						AND = {	
							exists = c:UZH
							scope:target_country = {
								this = c:UZH
							}
						}
						AND = {	
							exists = c:OZH
							scope:target_country = {
								this = c:OZH
							}
						}
						AND = {	
							exists = c:KOK
							scope:target_country = {
								this = c:KOK
							}
						}
						AND = {	
							exists = c:KHI
							scope:target_country = {
								this = c:KHI
							}
						}
						AND = {	
							exists = c:BUK
							scope:target_country = {
								this = c:BUK
							}
						}
						AND = {	
							exists = c:AFG
							scope:target_country = {
								this = c:AFG
							}
						}
					}
				}
				add = 100
			}

			if = { #Indian suzerain will be aggressive against Afganistan, if Afghanistan is threatened by Russia.
				limit = {
					AND = {
						c:RUS ?= {
							any_scope_state = {
								OR = {
									state_region = s:STATE_UZBEKIA
									state_region = s:STATE_KIRGHIZIA
									state_region = s:STATE_KHIVA
									state_region = s:STATE_TURKMENIA
									state_region = s:STATE_TAJIKISTAN
								}
							}
						}
						ROOT = {
							country_is_in_europe = yes
			        		OR = {
			        			any_scope_state = {
			        				OR = {
			    						region = sr:region_north_india
			    						region = sr:region_south_india
			    					}
									count >= 3
			        			}
			        			any_country = {
			        				is_subject_of = prev
			        				any_scope_state = {
			        					OR = {
			        						region = sr:region_north_india
			        						region = sr:region_south_india
			        					}
										count >= 3
				        			}
			        			}
			        		}
						}
						scope:target_country = {
							any_scope_state = {
								OR = {
									state_region = s:STATE_EASTERN_AFGHANISTAN
									state_region = s:STATE_WESTERN_AFGHANISTAN
								}
							}
						}
					}
				}
				add = 50
			}

			if = {
				limit = {
					lenient_ai_behavior_trigger = yes
				}
				multiply = 0.5
			}

			if = {
				limit = {
					AND = {
						NOT = {
							has_law = law_type:law_council_republic
						}
						scope:target_country = {
							has_law = law_type:law_council_republic	
						}
					}
					
				}
				add = 50
			}
			
			#if = {
			#	limit = {
			#		can_reach_target_country = yes
			#		has_technology_researched = colonization
			#		OR = {
			#			is_country_type = recognized
			#			is_country_type = colonial
			#		}
			#		scope:target_country = {
			#			is_country_type = unrecognized
			#			country_is_in_africa = no
			#		}
			#	}
			#	add = 15
			#}
			#
			#if = {
			#	limit = {
			#		can_reach_target_country = yes
			#		has_technology_researched = colonization
			#		OR = {
			#			is_country_type = recognized
			#			is_country_type = colonial
			#		}
			#		scope:target_country = {
			#			is_country_type = unrecognized
			#			country_is_in_africa = yes
			#		}
			#	}
			#	add = 15
			#}
			
			if = {
				limit = {
					can_reach_target_country = yes
					has_technology_researched = civilizing_mission
					has_colonial_growth = yes
					OR = {
						is_country_type = recognized
						is_country_type = colonial
					}
					scope:target_country = {
						is_country_type = unrecognized
						country_is_in_north_america = no
						country_is_in_central_america = no
						country_is_in_south_america = no
					}
				}
				add = 50
			}
			
			if = {
				limit = {
					can_reach_target_country = yes
					has_technology_researched = civilizing_mission
					has_colonial_growth = yes
					OR = {
						is_country_type = recognized
						is_country_type = colonial
					}
					scope:target_country = {
						is_country_type = unrecognized
						country_is_in_africa = yes
					}
				}
				add = 50
			}

			min = 0
			max = 100			
		}
		
		make_dominion = {
			if = {
				limit = {
					OR = {
						has_secret_goal = {
							who = scope:target_country
							secret_goal = protect
						}
						has_secret_goal = {
							who = scope:target_country
							secret_goal = dominate
						}			
					}
				}
				
				add = {
					value = 50
				
					add = {
						value = scope:target_country.gdp
						divide = 200000
						max = 50						
					}

					if = {
						limit = {
							has_strategic_adjacency = scope:target_country
						}
						multiply = 1.25
					}						
				}
			}
			
			if = {
				limit = {
					OR = {
						has_journal_entry = je_sick_man_egypt
						has_journal_entry = je_veiled_protectorate
					}
					exists = c:EGY
					scope:target_country = c:EGY
				}
				add = 100
			}	

			if = { #Indian suzerain will be aggressive against Afghanistan
				limit = {
					AND = {
						c:RUS ?= {
							any_scope_state = {
								OR = {
									state_region = s:STATE_UZBEKIA
									state_region = s:STATE_KIRGHIZIA
									state_region = s:STATE_KHIVA
									state_region = s:STATE_TURKMENIA
									state_region = s:STATE_TAJIKISTAN
								}
							}
						}
						ROOT = {
							country_is_in_europe = yes
			        		OR = {
			        			any_scope_state = {
			        				OR = {
			    						region = sr:region_north_india
			    						region = sr:region_south_india
			    					}
									count >= 3
			        			}
			        			any_country = {
			        				is_subject_of = prev
			        				any_scope_state = {
			        					OR = {
			        						region = sr:region_north_india
			        						region = sr:region_south_india
			        					}
										count >= 3
				        			}
			        			}
			        		}
						}
						scope:target_country = {
							any_scope_state = {
								OR = {
									state_region = s:STATE_EASTERN_AFGHANISTAN
									state_region = s:STATE_WESTERN_AFGHANISTAN
								}
							}
						}
					}
				}
				add = 50
			}

			if = {
				limit = {
					AND = {
						NOT = {
							has_law = law_type:law_council_republic
						}
						scope:target_country = {
							has_law = law_type:law_council_republic	
						}
					}
					
				}
				add = 50
			}

			if = {
				limit = {
					lenient_ai_behavior_trigger = yes
				}
				multiply = 0.5
			}

			min = 0
			max = 100				
		}
		
		make_vassal = {
			if = {
				limit = {
					OR = {
						has_secret_goal = {
							who = scope:target_country
							secret_goal = protect
						}
						has_secret_goal = {
							who = scope:target_country
							secret_goal = dominate
						}				
					}
				}
				
				add = {
					value = 50
				
					add = {
						value = scope:target_country.gdp
						divide = 200000
						max = 50						
					}

					if = {
						limit = {
							has_strategic_adjacency = scope:target_country
						}
						multiply = 1.25
					}						
				}
			}
			
			if = {
				limit = {
					OR = {
						has_journal_entry = je_sick_man_egypt
						has_journal_entry = je_veiled_protectorate
					}
					exists = c:EGY
					scope:target_country = c:EGY
				}
				add = 100
			}	

			if = {
				limit = {
					AND = {
						NOT = {
							has_law = law_type:law_council_republic
				}
						scope:target_country = {
							has_law = law_type:law_council_republic	
						}
					}
					
				}
				add = 50
			}	

			if = {
				limit = {
					lenient_ai_behavior_trigger = yes
				}
				multiply = 0.5
			}
			
			min = 0
			max = 100			
		}	

		war_reparations = {
			value = 0
			
			add = {
				value = "scope:target_country.ai_gdp_comparison(root)"
				add = 1
				multiply = 5
				min = 0
				max = 15

				if = {
					limit = {
						has_diplomatic_pact = {
							who = scope:target_country
							type = rivalry
						}						
					}
					
					multiply = 1.5
				}
			}
			
			if = {
				limit = {
					has_journal_entry = je_opium_wars
					scope:target_country = {
						has_variable = opium_wars_target
					}
				}
				add = 50
			}	

			if = {
				limit = {
					has_journal_entry = je_opium_obsession
					scope:target_country = {
						has_variable = opium_wars_aggressor
					}
				}
				add = 50
			}

			min = 0
			max = 100			
		}	

		humiliation = {
			value = 25
		}	

		regime_change = {
			value = 0
			
			if = {
				limit = {
					country_rank >= rank_value:major_power					
					OR = {
						has_diplomatic_pact = {
							who = scope:target_country.top_overlord
							type = rivalry
						}	
						"ai_ideological_opinion(scope:target_country)" <= -25	
					}
				}
				add = 10
			}					

			if = {
				limit = {
					AND = {
						NOT = {
							has_law = law_type:law_council_republic
						}
						scope:target_country = {
							has_law = law_type:law_council_republic	
						}
					}
					
				}
				add = 250
			}						
		}		
		
		open_market = {
			value = 0
			
			if = {
				limit = {
					scope:target_country = {
						has_diplomatic_pact = {
							who = root
							type = embargo
						}	
					}
					can_reach_target_country = yes
				}
				add = 50
			}			
		
			if = {
				limit = {
					has_journal_entry = je_opium_wars
					scope:target_country = {
						has_variable = opium_wars_target
					}
				}
				add = 75
			}

			if = {
				limit = {
					AND = {
						NOT = {
							has_law = law_type:law_council_republic
						}
						scope:target_country = {
							has_law = law_type:law_council_republic	
						}
					}
					
				}
				add = 50
			}

			min = 0
			max = 200	
		}	

		ban_slavery = {
			value = 0
			
			if = {
				limit = {
					country_rank >= rank_value:major_power
					OR = {
						has_strategy = ai_strategy_progressive_agenda
						has_strategy = ai_strategy_egalitarian_agenda
					}					
				}

				add = {
					value = scope:target_country.gdp
					divide = 100000
					max = 25						
				}

				
				# Relations with target
				multiply = {
					value = "scope:target_country.relations:root"
					multiply = -0.01
					add = 1
					min = 0.5
					max = 2.0				
				}
				
				# Ideological opinion of target
				multiply = {
					value = "ai_ideological_opinion(scope:target_country)"
					multiply = -0.05
					add = 1
					min = 0.5
					max = 2.0
				}				
			}
			
			min = 0
			max = 100
		}		

		revoke_claim = {
			if = {
				limit = {
					scope:target_state = { owner = root }
				}
				
				add = 10
			
			add = {
				value = scope:target_state.state_population
				divide = 200000
				max = 10						
			}
			
			add = {
				value = scope:target_state.gdp
				divide = 200000
				max = 10						
			}											
			
			if = {
				limit = {
					scope:target_state = { is_homeland_of_country_cultures = root }
				}
				multiply = 1.25
			}

			if = {
				limit = {
					scope:target_state = { is_incorporated = no }
				}
				multiply = 0.5
				}				
			}

			min = 0
			max = 50			
		}	

		contain_threat = {
			value = 1000
		}	

		annex_country = {
			value = 100
		
			add = {
				value = scope:target_country.gdp
				divide = 100000
				max = 100						
			}

			if = {
				limit = {
					has_strategic_adjacency = scope:target_country
				}
				multiply = 1.5
			}									
			
			if = {
				limit = {
					lenient_ai_behavior_trigger = yes
				}
				multiply = 0.0
			}

			if = {
				limit = {
					country_has_primary_culture = cu:russian
					has_law = law_type:law_national_supremacy
					has_technology_researched = nationalism
					OR = {
						AND = {	
							exists = c:KZH
							scope:target_country = c:KZH
						}
						AND = {	
							exists = c:UZH
							scope:target_country = c:UZH
						}
						AND = {	
							exists = c:OZH
							scope:target_country = c:OZH
						}
					}
				}
				add = 150
			}
			
			if = {
				limit = {
					can_reach_target_country = yes
					has_technology_researched = civilizing_mission
					scope:target_country = {
						country_is_in_africa = yes
						is_country_type = unrecognized
					}
				}
				add = 75
			}
		
			# French conquest of Algeria
			if = {
				limit = {
					exists = c:FRA
					THIS = c:FRA
					scope:target_country.capital = {
						OR = {
							state_region = s:STATE_TLEMCEN
							state_region = s:STATE_ALGIERS
							state_region = s:STATE_CONSTANTINE
							state_region = s:STATE_TOUGGOURT
							state_region = s:STATE_GHARDAIA
							state_region = s:STATE_SAHARA
							state_region = s:STATE_EAST_SAHARA
						}
					}
				}
				add = 100
			}

			min = 0
			max = 200			
		}			
		
		colonization_rights = {
			value = 100
		}	

		unification = {
			value = 100
		
			add = {
				value = scope:target_country.gdp
				divide = 100000
				max = 100						
			}

			if = {
				limit = {
					has_strategic_adjacency = scope:target_country
				}
				multiply = 1.5
			}	
			
			if = {
				limit = {
					lenient_ai_behavior_trigger = yes
				}
				multiply = 0.0
			}

			min = 0
			max = 200				
		}

		#unification_leadership = {
		#	value = 100
		#
		#	#add = {
		#	#	value = scope:target_country.gdp
		#	#	divide = 100000
		#	#	max = 100				
		#	#}
		#
		#	if = {
		#		limit = {
		#			has_strategic_adjacency = scope:target_country
		#		}
		#		multiply = 1.25
		#	}
		#
		#	min = 0
		#	max = 200				
		#}	

		liberate_subject = {
			value = 0	
			
			if = {
				limit = {
					scope:target_country.top_overlord.infamy >= infamy_threshold:notorious		
				}
				add = 25
				
				if = {
					limit = {
						has_diplomatic_pact = {
							who = scope:target_country.top_overlord
							type = rivalry
						}							
					}
					add = 25
				}
				
				if = {
					limit = {
						scope:target_country = {
							has_attitude = {
								who = scope:target_country.top_overlord
								attitude = rebellious
							}
						}						
					}
					add = 35
				}

				if = {
					limit = {
						scope:target_country.top_overlord.infamy >= infamy_threshold:pariah
					}
					add = 25
				}

				# Relations with subject
				multiply = {
					value = "scope:target_country.relations:root"
					multiply = 0.01
					add = 1
					min = 0.25
					max = 2.0				
				}
				
				# Ideological opinion of subject
				multiply = {
					value = "ai_ideological_opinion(scope:target_country)"
					multiply = 0.05
					add = 1
					min = 0.25
					max = 2.0
				}				
			}	

			min = 0
			max = 100			
		}	

		liberate_country = {
			value = 0
		
			if = {
				limit = {
					scope:target_country.infamy >= infamy_threshold:notorious
				}
				add = 25
				
				if = {
					limit = {
						has_diplomatic_pact = {
							who = scope:target_country
							type = rivalry
						}			
					}
					add = 25
				}

				if = {
					limit = {
						scope:target_country.infamy >= infamy_threshold:pariah
					}
					add = 25
				}

				# Relations with target
				multiply = {
					value = "scope:target_country.relations:root"
					multiply = -0.01
					add = 1
					min = 0.5
					max = 2.0				
				}
				
				# Ideological opinion of target
				multiply = {
					value = "ai_ideological_opinion(scope:target_country)"
					multiply = -0.05
					add = 1
					min = 0.5
					max = 2.0
				}				
			}

			min = 0
			max = 100				
		}

		force_recognition = {
			value = 0
			
			if = {
				limit = {
					country_rank = rank_value:unrecognized_major_power
					navy_size >= 50
					army_size >= 200
					OR = {
						has_strategy = ai_strategy_nationalist_agenda
						has_strategy = ai_strategy_progressive_agenda
						has_strategy = ai_strategy_egalitarian_agenda
					}
				}
				add = 100
			}
		}	

		independence = {
			value = 100
		}	

		secession = {
			value = 100
		}		
	}

	# Trigger for whether this strategy can be randomly allocated to a country
	possible = {
		always = no
	}
	
	# Chance that this strategy will be randomly allocated to a country
	weight = {
		value = 0		
	}
}